/** Flush/discard any data in device buffers. */

#ifndef __TEST_MODULE_H_
#define __TEST_MODULE_H_

#include "avdl_timmod_pvt_structs.h"

#define _LINUX_USER_
//#define _LINUX_DRV_
//#define _WIN32_USER_ 

#define TEST_RESULT_FILE "./log_timmod_result.xls"
#define PTS_NUM_FOR_TEST 51
#define PTS_OFFSET	48000	

#ifdef _WIN32_USER_
#define _USER_TEST_
#define avdl_timmod_user_open avdl_timmod_open
#define avdl_timmod_user_close avdl_timmod_close
#define avdl_timmod_user_open_channel avdl_timmod_channel_open
#define avdl_timmod_user_close_channel avdl_timmod_channel_close
#define avdl_timmod_user_set_clock avdl_timmod_set_clock
#define avdl_timmod_user_set_play_rate avdl_timmod_set_play_rate
#define avdl_timmod_user_set_base_time avdl_timmod_set_base_time
#define avdl_timmod_user_pts_transform avdl_timmod_pts_transform
#endif

#ifdef _LINUX_USER_
#define _USER_TEST_
#include <linux/ioctl.h>
#include <sys/time.h>
#include <unistd.h>
#include <stdbool.h>
#include <unistd.h>
#define avdl_timmod_user_open avdl_timmod_open
#define avdl_timmod_user_close avdl_timmod_close
#define avdl_timmod_user_open_channel avdl_timmod_channel_open
#define avdl_timmod_user_close_channel avdl_timmod_channel_close
#define avdl_timmod_user_set_clock avdl_timmod_set_clock
#define avdl_timmod_user_set_play_rate avdl_timmod_set_play_rate
#define avdl_timmod_user_set_base_time avdl_timmod_set_base_time
#define avdl_timmod_user_pts_transform avdl_timmod_pts_transform
#endif

#ifdef _LINUX_DRV_
#include <linux/ioctl.h>
#include <sys/time.h>
#include <unistd.h>
#include <stdbool.h>
#include <unistd.h>
#endif




#include <signal.h>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>

#include <string.h>




typedef enum {
	TEST_RESULT_PASS,
	TEST_RESULT_INCONCLUSIVE,
	TEST_RESULT_FAIL,
	TEST_RESULT_ERROR
} test_result_t;

typedef int32_t ismd_dev_handle_t;

#define CHECK_RESULT(rslt) \
	if (AVDL_SUCCESS != rslt) { \
		printf("\n!!!!!@ERROR@!!!!!!!: %d\n", rslt); \
	} else { \
		printf("okay.\n"); \
	} do {} while (0)


#endif
